package exercise.day9;

import java.util.Scanner;

/**
 * @author Dianzhi Han
 * @version 1.0
 * @description: TODO
 * @date 2022/11/5 1:31
 */
public class HJ91_TheNumberOfSquareWalkingChemes {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
//输入多组样例，所以要循环读出
        while (sc.hasNext()) {
            int n = sc.nextInt();
            int m = sc.nextInt();
            System.out.println(med(m, n));
        }
    }
    public static int med(int n, int m) {
//当m==1或者n==1的时候总的路径数为m+n
        if ((n == 1 && m >= 1) || (m == 1 && n >= 1)) {
            return m + n;
        }
        return med(n - 1, m) + med(n, m - 1);
    }
}
